
Parent.prototype.getName = function () {

    return this.name
}

function parent() {

    this.name = 'Tom'
    this.like = [1, 2, 3]
}
function Child() {


    Parent.call(this)
    this.type = 'children'
}

Child.prototype = Object.create(Parent.prototype)  // Object.create创建了一个新的对象
Child.prototype.constructor = Child

let s1 = new Child()
s1.like.push(4)
